package cn.hyq.org.domain;

import cn.hyq.basic.domain.BaseDomain;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Department extends BaseDomain {
    @ApiModelProperty(value = "部门编号")
    private String sn;
    @ApiModelProperty(value = "部门名称")
    private String name;
    @ApiModelProperty(value = "部门的上级分类层级id")
    private String dirPath;

    //查询我的儿子们一对多
    @JsonInclude(JsonInclude.Include.NON_EMPTY)//集合不为空才返回
    private List<Department> children = new ArrayList<>();

    @ApiModelProperty(value = "部门状态，0正常，1禁用")
    private Integer state;
    @ApiModelProperty(value = "部门管理员，关联Employee表id")
    private Long manager_id;
    @ApiModelProperty(value = "上级部门")
    private Long parent_id;
    private Long shop_id;

    //一对多
    private Employee employee;

    //自连接
    private Department parent;



}
